package ReadWriteFieldsRelations;


import java.io.IOException;
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;


public class MethodDependences {


	  public static void main(String[] args)throws ClassNotFoundException {
		  System.out.println("Depenedences Class....");
		    List<String> list = new LinkedList<String>();
		    


	//    list.add("toyexamples.Stack");
	
	//	     list.add("BitSet.BitSet");
//	    list.add("database.Driver");
//	    list.add("database.Statement");
//	    list.add("database.DBConnection");
//		    list.add("roops.shoppingcart.cart.Cart");
//		    list.add("roops.shoppingcart.coupons.AnniversaryCoupon");
//		    list.add("roops.shoppingcart.coupons.ClearanceCoupon"); 
//		    list.add("roops.shoppingcart.coupons.Coupon");
//		    list.add("roops.shoppingcart.products.BlackPen");
//		    list.add("roops.shoppingcart.products.RedPen");
		    list.add("roops.shoppingcart.products.Product");
		    MethodRelations relations = new MethodRelations(list);
		    try {		    	
		    		relations.buildRelations();
				    System.out.println(relations.showFieldReadWrites());
				    System.out.println(relations.showDependence());
				    relations.buildWriteFiledMethodDependence();
				    Map<Method, ReadWriteMethods> methodsReadFields=  new LinkedHashMap<Method, ReadWriteMethods>();
//				    for(int i=0;i<list.size();i++)
//				    	methodsReadFields= relations.getMethodsReadFileds(list.get(i).getName().toString());
				    System.out.println();
		    } catch (IOException e) {
		    		throw new RuntimeException(e);
		    }

		  }
}
